/**
 * @file       ExectuteZone.h
 * @brief      The auxiliary class for Security locking and unlocking
 * @author     Huabo Zheng
 * @date       Jan 20, 2012
 * @Copyright  2012, www.netgear.com Inc. All rights reserved.
 */

#ifndef EXECTUTEZONE_H_
#define EXECTUTEZONE_H_

#include "Object.h"
#include "Mutex.h"
#include "typedefine.h"

namespace NS_LCD_AFW
{

/**
 *@class  CExectuteZone
 *@brief  The auxiliary class for Security locking and unlocking
 */
class CExectuteZone: public NS_LCD_AFW::CObject
{
public:

	/**
	*@brief DeConstructor
	*@details
	*@param[in]  pMutex A pointer to a CMutex object
	*/
	CExectuteZone(CMutex *pMutex) :
			m_pLock(pMutex)
	{
		if (NULL != m_pLock)
		{
			m_pLock->lock();
		}
	}

	/**
	*@brief DeConstructor
	*/
	virtual ~CExectuteZone()
	{
		if (NULL != m_pLock)
		{
			m_pLock->unLock();
		}
	}

private:
	CMutex *m_pLock;

private:
DISABLE_COPY_CONSTRUCTOR_AND_ASSIGN_REFERENCE(CExectuteZone);
};

} /* namespace NS_LCD_AFW */
#endif /* EXECTUTEZONE_H_ */
